package com.oauth.utils;

import android.util.Log;

/**
 * 日志工具
 * 
 * @see :
 * @Copyright : 2011-2088 Chineseall. All Rights Reserved.
 * @author : bywyu
 * @since：Jdk1.6
 * @version : 1.0
 * @date : 2011-6-8 下午02:16:41
 * 
 */
public class LogUtil {

	private static final String TAG = "OATUTHTEST";

	// static{
	// System.out.println("test .. ");
	// }

	/**
	 * Log.i打印日志信息
	 * 
	 * @param c
	 *            类文�? * @param msg 打印的日志信�?
	 */
	public static void i(Object o, String msg) {

		String cName = getClassName(o);
		Log.i(TAG, cName + " " + msg);
	}

	/**
	 * Log.d打印日志信息
	 * 
	 * @param c
	 *            类文�? * @param msg 打印的日志信�?
	 */
	public static void d(Object c, String msg) {
		String cName = getClassName(c);
		Log.d(TAG, cName + " " + msg);
	}

	/**
	 * 获取文件类名（去除之前的包名�? * @param c
	 * 
	 * @return 类名
	 */
	private static String getClassName(Object o) {

		Class<? extends Object> c = o.getClass();
		String cName = c.getName();
		String[] tmp = cName.split("\\.");
		cName = tmp[tmp.length - 1];

		return cName;
	}
}
